﻿using System.Collections.Generic;
using System.Runtime;

namespace System.Reflection
{
    [NonScript]
    public abstract class MemberInfo : ICustomAttributeProvider
    {
        public abstract MemberTypes MemberType { get; }
        public abstract string Name { get; }
        public abstract Type DeclaringType { get; }
        public abstract Type ReflectedType { get; }

        public virtual int MetadataToken
        {
            get { return 0; }
        }

        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        protected MemberInfo()
        {
        }

        internal virtual bool CacheEquals(object o)
        {
            return false;
        }

        public abstract object[] GetCustomAttributes(bool inherit);
        public abstract object[] GetCustomAttributes(Type attributeType, bool inherit);
        public abstract bool IsDefined(Type attributeType, bool inherit);

        public virtual IList<CustomAttributeData> GetCustomAttributesData()
        {
            return null;
        }

        public static bool operator ==(MemberInfo left, MemberInfo right)
        {
            return false;
        }

        [TargetedPatchingOptOut("Performance critical to inline across NGen image boundaries")]
        public static bool operator !=(MemberInfo left, MemberInfo right)
        {
            return !(left == right);
        }

        public override bool Equals(object obj)
        {
            return base.Equals(obj);
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }
    }
}
